package com.shketai.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.shketai.entity.Interview;
import com.shketai.service.InterviewService;


public class InterviewAction extends ActionSupport implements ModelDriven<Interview>{

	private static final long serialVersionUID = 1L;
	
	private InterviewService interviewService;
	
	private int id;
	
	private String InterviewingSubject; //面试科目
	
	
	
	private int result;
	
	private List<Interview> interviews;
	
	private Interview interview = new Interview();

	public void setInterviewService(InterviewService interviewService) {
		this.interviewService = interviewService; 
	}

	/**
	 * 增加面试科目
	 * @param interview
	 * @return
	 */
	public String add(){
		result = interviewService.add(interview);
		return SUCCESS;
	}
	/**
	 * 修改面试科目
	 * @param interview
	 * @return
	 */
	public String update(){
		result = interviewService.update(interview);
		return SUCCESS;
	} 
	
	public String findAllInterview(){
		interviews = interviewService.findAllInterview();
		//result = 1;
		return SUCCESS;
	}

	public Interview getModel() {
		return interview;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getInterviewingSubject() {
		return InterviewingSubject;
	}

	public void setInterviewingSubject(String interviewingSubject) {
		InterviewingSubject = interviewingSubject;
	}

	public Interview getInterview() {
		return interview;
	}

	public void setInterview(Interview interview) {
		this.interview = interview;
	}

	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public List<Interview> getInterviews() {
		return interviews;
	}

	public void setInterviews(List<Interview> interviews) {
		this.interviews = interviews;
	}
	
	
	
}
